package com.hqyj.project.mapper;

import com.hqyj.project.entity.Setting;
import com.hqyj.project.dto.SettingDto;
import com.hqyj.project.dto.UserDto;
import com.hqyj.project.entity.Attendance;
import com.hqyj.project.entity.AttendanceStatistics;
import com.hqyj.project.entity.Leave;
import org.springframework.stereotype.Service;

import java.util.List;


public interface AttendanceMapper {
    void insertAttendanceByUserId(Attendance attendance);
    // 查询打卡情况，避免重复打卡
    List<Attendance> selectAttendance(Attendance attendance);
    // 查询员工请假、出差、早退、迟到的情况
    List<AttendanceStatistics> selectAttendanceStatistics(AttendanceStatistics attendanceStatistics);
    // 将每次的打卡情况写入考勤统计表中
    void insertAttendanceStatisticsById(AttendanceStatistics attendanceStatistics);
    // 更新
    void updateAttendanceStatisticsById(AttendanceStatistics attendanceStatistics);
    // 关联查询（attendance_statistics,user)

    List<UserDto> selectAttendanceStatisticsAndUser(AttendanceStatistics attendanceStatistics);

    // 记录员工的请假、迟到、早退次数
    void insertSettingByUserId(Setting setting);

    // 查询
    List<Setting> selectSetting(Setting setting);

    // 更新次数
    void updateSettingByUserId(Setting setting);

    // 查询请假的员工
    List<Leave> selectLeaveById(Leave leave);

    // 查询每月请假、迟到、早退次数最多的员工
    List<SettingDto> selectSettingDtoEarly();
    List<SettingDto> selectSettingDtoLeave();
    List<SettingDto> selectSettingDtoLate();

    // 查询需要通告的员工
    List<SettingDto> selectSettingDtoReport(SettingDto settingDto);
}
